package bridge

import (
	"gitee.com/tomatomeatman/golang-repository/bricks3/function/configutil"
	"gitee.com/tomatomeatman/golang-repository/bricks3/model/msgentity"
	"github.com/gin-gonic/gin"
)

type SystemParamsService struct {
}

var (
	systemParamsServiceName = "" //桥接到登录服务的服务名,默认GBaseSystemServer
	//systemParamsServiceName  = "" //桥接到登录服务的服务密钥
)

// 初始化
func init() {
	if configutil.HasSection("./config/app.ini", "CloudCenter") { //禁用桥接
		return
	}

	systemParamsServiceName = configutil.ReadConfigKey("", "CloudServer", "BaseServerName", "GBaseSystemServer").(string)
	//systemParamsServiceName = configutil.ReadConfigKey("", "CloudServer", "BaseServerKey", "").(string)
}

/**
 * 取所有免拦截系统参数对象集合
 * @return
 */
func (service SystemParamsService) FindByNoIntercept(ctx *gin.Context) (bool, string, interface{}) {
	bl, msg, data := BridgeDao{}.Post(ctx, systemParamsServiceName, "/system/params/insidevisit/find/not/intercept", nil, &msgentity.MsgEntity{})
	if !bl {
		return bl, msg, data
	}

	me := data.(*msgentity.MsgEntity)

	return me.Success, me.Msg, me.Data
}
